<template>
	<view >
		<view class="m-b-10">
			<image src="/static/img/sanwei.jpg" alt="三违" style="width: 100vw" mode="widthFix"  @click="click" />
		</view>
		<view>
			<template v-for="(item, index) in appCategoryList" :index="index">
				<applicationItem v-bind="item" :appList="item.appList" />
			</template>
		</view>
		<u-overlay :show="mainStore.showTip" @click="closemask"></u-overlay>
	</view>
	
</template>
<script setup>
// import { onShow } from '@dcloudio/uni-app';
import { computed, ref } from 'vue';
// import { getAuthorization } from '@/router/auth.js';
import { useMainStore } from '@/store/index.js';
// import { setMessageBadge } from '@/hooks/com.js';
import applicationItem from './application-item.vue';

const mainStore = useMainStore();
let noticeInfo = ref(['系统']);

const appCategoryList = computed(() => {
	mainStore.fastList.forEach((item) => {
		item.tip = false;
	});
	return [
		{
			title: '三违信息模块',
			appList: [
				{
					path: '/pages/manage/index',
					icon: 'manage.png',
					name: '三违信息管理'
				},
				{
					path: '/pages/manage/approval',
					icon: 'approval.png',
					name: '三违信息审批'
				}
			]
		},
		{
			title: '数据分析',
			appList: [
				{
					path: '/pages/cockpit/index',
					icon: 'home.png',
					name: '三违驾驶舱'
				},
				{
					path: '/pages/analysis/index',
					icon: 'analysis.png',
					name: '统计分析'
				}
			]
		}
	];
});
const closemask = () => {
	if (!mainStore.overlay) {
		mainStore.showTip = false;
	}
	mainStore.overlay = false;
};
// const getNotice = async () => {
// 	try {
// 		const {
// 			data = []
// 		} = await getNoticeData()
// 		noticeInfo.value = data.map((item, index) =>
// 			`${index + 1}.上报日期:${item.checkDate} 风险点:${item.riskLocationName} `)
// 	} catch (e) {
// 		//TODO handle the exception
// 	}
// }
// onShow(() => {
// 	if (getAuthorization('accessToken')) {
// 		getNotice()
// 		setMessageBadge()
// 	}
// });
</script>
<style lang="scss" scoped>

.mask {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999;
	width: 100%;
	height: 100%;
	pointer-events: auto;
	background: rgba(0, 0, 0, 0.4);
	transition-property: opacity;
	transition-duration: 300ms;
	transition-timing-function: ease-out;
}

.mask {
}
</style>